﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RoleAccreditEdit.aspx.cs"
    Inherits="HQWeb.SysManage.RoleManage.RoleAccreditEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
   <%-- <link href="../../Styles/Site.css" rel="Stylesheet" type="text/css" />--%>
    <link href="../../Styles/GridViewStyle.css" rel="Stylesheet" type="text/css" />
    <script language="javascript" type="text/javascript">
        function OpenShow() {
            var str = window.showModalDialog('RoleAccreditTreeFrame.htm', '加入菜单', 'status:0;dialogHeight:415px;dialogWidth:600px');
            window.close();
            window.document.location.reload();
        }
        function OpenSysTree() {
            // var str=window.showModalDialog('MenuAddRole.aspx','加入菜单','status:0;dialogHeight:415px;dialogWidth:400px');
            var url = "MenuAddRole.aspx";
            window.open(url, "加入菜单", "width=350,top=200,left=400,height=400,location=no,menubar=no,scrollbars=yes,titlebar=no,toolbar=no,status=no,resizable=no");
        }

        function expandcollapse(obj, row) {
            var div = document.getElementById(obj);
            var img = document.getElementById('img' + obj);

            if (div.style.display == "none") {
                div.style.display = "block";
                if (row == 'alt') {
                    img.src = "../../Images/collapse_blue.jpg";
                }
                else {
                    img.src = "../../Images/collapse_blue.jpg";
                }
                img.alt = "关闭显示";
            }
            else {
                div.style.display = "none";
                if (row == 'alt') {
                    img.src = "../../Images/expand_blue.jpg";
                }
                else {
                    img.src = "../../Images/expand_blue.jpg";
                }
                img.alt = "显示下级菜单";
            }
        } 
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="title">
        <asp:Label ID="Label7" runat="server" Text="角色名: "></asp:Label><asp:Label ID="ROLENAME"
            runat="server"></asp:Label>
    </div>
    <div>
        <input value="加入菜单" type="button" onclick="OpenSysTree();">
    </div>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CssClass="GridViewStyle" PageSize="25"
        Width="100%" AllowPaging="True" AllowSorting="True" CellPadding="4" EmptyDataText="没有数据记录！！"
        DataKeyNames="r_uid" OnRowDeleting="GridView1_RowDeleting" OnPageIndexChanging="GridView1_PageIndexChanging"
        OnRowDataBound="GridView1_RowDataBound" GridLines="None">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <a href="javascript:expandcollapse('div<%# Eval("mid") %>', 'one');">
                        <img id="imgdiv<%# Eval("mid") %>" alt="点击显示/隐藏下级菜单 <%# Eval("mid") %>" width="9px"
                            border="0" src="../../Images/expand_blue.jpg" />
                    </a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="r_uid" HeaderText="编号" ItemStyle-Width="10%" />
            <asp:BoundField DataField="mname" HeaderText="菜单名 " ItemStyle-Width="90%" />
            <asp:TemplateField HeaderText="菜单ID" Visible="False">
                <ItemTemplate>
                    <asp:Label ID="mid" runat="server" Text='<%# Bind("mid") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="功能" ItemStyle-Width="20%">
                <ItemTemplate>
                    <asp:LinkButton ID="DelButton" Text="删除" CommandName="Delete" runat="server" OnClientClick="javascript:return confirm('确认要删除此行信息吗？')" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <tr>
                        <td colspan="100%">
                            <div id="div<%# Eval("mid") %>" style="display: none; position: relative; left: 15px;
                                overflow: auto; width: 97%">
                                <asp:GridView ID="GridView2" AllowPaging="False" AllowSorting="true" BackColor="White"
                                    Width="100%" AutoGenerateColumns="false" Font-Names="Verdana" runat="server"
                                    DataKeyNames="r_uid" ShowFooter="true" OnRowDeleting="GridView2_RowDeleting"
                                    BorderStyle="Double" BorderColor="#0083C1">
                                    <RowStyle BackColor="Gainsboro" />
                                    <AlternatingRowStyle BackColor="White" />
                                    <HeaderStyle BackColor="#0083C1" ForeColor="White" />
                                    <FooterStyle BackColor="White" />
                                    <Columns>
                                        <asp:BoundField DataField="r_uid" HeaderText="编号" />
                                        <asp:BoundField DataField="mname" HeaderText="菜单名 " />
                                        <asp:TemplateField HeaderText="功能">
                                            <ItemTemplate>
                                                <asp:LinkButton ID="DelButton" Text="删除" CommandName="Delete" runat="server" />
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </div>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <RowStyle BackColor="#EFF3FB" />
        <EditRowStyle BackColor="#2461BF" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <AlternatingRowStyle BackColor="White" />
        <HeaderStyle CssClass="GridViewHeaderStyle" />
    </asp:GridView>
    <div>
        <asp:TextBox ID="txtIdHid" runat="server" Visible="false" />
    </div>
    </form>
</body>
</html>
